<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('审批管理')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p>关键字：</p>
                                <input type="text" name="keyword"/>
                            </li>
                            <li>
							项目类型：<select name="projectType" th:with="type=${@dict.getType('sys_normal_disable')}">
							            <option value="">全部</option>
										<option value="房建">房建</option>
										<option value="市政">市政</option>
								   </select>
							</li>
							<li class="select-time">
                                <p>上报时间：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="beginReportTime"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endReportTime"/>
                            </li> 
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                 <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:src="@{/js/plugins/datetime/moment.js}"></script>
    <script th:inline="javascript">
    var prefix = ctx + "completion/boss";
    var proPrefix = ctx + "projectArchives/projectArchives";
    var enterPriseprefix = ctx + "enterprise/enterprise";
    
    $(function() {
    	 var options = {
    			url: prefix + "/list",
    			updateUrl: prefix + "/edit/{id}",
    			detailFourUrl: proPrefix + "/detail/{id}",
    			detailOneUrl: enterPriseprefix + "/bulidUnitDetail/{id}",
    			detailTwoUrl: enterPriseprefix + "/detail/{id}",
                modalName: "竣工备案备案管理",
                columns: [{
                        field: 'id',
                        title: '序号',
						formatter: function (value, row, index) {
						
						    return index + 1;
						}
                    },
                    {
                        field: 'engineeringName',
                        title: '工程名称'
	                },
                    {
                        field: 'projectInfoGuid',
                        title: '项目信息标识符',
						visible: false
	                }, 
					{
                        field: 'projectName',
                        title: '所属项目',
						formatter: function (value, row, index) {
							var actions = [];
							if(!$.common.isEmpty(row.projectInfoGuid) && !$.common.isEmpty(value)){
								actions.push('<a href="javascript:void(0)" onclick="$.operate.detailTabRewriteFour(\'' + value + '\',\''+ row.projectInfoGuid +'\')">'+value+'</a> ');
							}
							return actions.join('');
						}
                    },
                    {
                        field: 'constructUnitId',
                        title: '建设单位标识符',
						visible: false
                    },
                    {
                        field: 'constructUnit',
                        title: '建设单位',
						formatter: function (value, row, index) {
							var actions = [];
							if(!$.common.isEmpty(value) && !$.common.isEmpty(row.constructUnitId)){
								actions.push('<a href="javascript:void(0)" onclick="$.operate.detailTabRewriteOne(\'' + value + '\',\''+ row.constructUnitId +'\')">'+value+'</a> ');
								return actions.join('');
							}
						}
                    },
                    {
                        field: 'constructionUnitId',
                        title: '施工总包单位标识符',
						visible: false
                    },
                    {
                        field: 'constructionUnit',
                        title: '施工总包单位',
						formatter: function (value, row, index) {
							var actions = [];
							if(!$.common.isEmpty(value) && !$.common.isEmpty(row.constructionUnitId)){
								actions.push('<a href="javascript:void(0)" onclick="$.operate.detailTabRewriteTwo(\'' + value + '\',\''+ row.constructionUnitId +'\')">'+value+'</a> ');
								return actions.join('');
							}
						}
                    },
                    {
                        field: 'state',
                        title: '备案状态'
                    },
                    {
                        field: 'reportTime',
                        title: '申请时间',
						width:80,
						formatter: function (value, row, index) {
							if(value == '' || value == null){
								return value;
							}else{
								return moment(value).format('YYYY-MM-DD');	
							}
						}
	                },
                    {
                        field: 'licenseNum',
                        title: '规划许可',
						visible: false
	                },
                    {
                        field: 'constructionNum',
                        title: '施工许可证号',
						visible: false
	                },
                    {
                        field: 'projectType',
                        title: '项目类型',
						visible: false
		            },
                    {
                        field: 'guid',
                        title: '竣工备案标识符',
						visible: false
	                },
                    {
                        field: 'inChargeDepartmentGuid',
                        title: '行政主管部门标识符',
						visible: false
		            },
                    {
                        field: 'inChargeDepartment',
                        title: '行政主管部门',
						visible: false
			        },
                    {
	                    field: 'opera',
	                    title: '功能区',
                        formatter: function (value, row, index) {
                            var actions = [];
                            actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.editTabRewrite(\'' + row.engineeringName + '竣工备案申请表\',\'' + row.guid + '\')"><i class="fa fa-edit"></i>申请表</a> ');
                            return actions.join('');
	                       }
	                }]
        };
    	$.table.init(options);
    });
    </script>
</body>
</html>